package problem461;

//461.汉明距离
//https://leetcode.cn/problems/hamming-distance/

class Solution {
    public int hammingDistance(int x, int y) {
        int k = x^y;
        int ret = 0;
        for(int i = 0; i<32; i++) {
            ret += (k >> i) & 1;
        }
        return ret;
    }
}